//
//  FQDetailListHeaderCollectionReusableView.swift
//  SwiftProject
//
//  Created by 董駸 on 2023/4/17.
//

import UIKit

class FQDetailListHeaderCollectionReusableView: UICollectionReusableView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        let view = UIView()
        view.backgroundColor = .white
        view.clipsToBounds = true
        view.layer.cornerRadius = 8
        view.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
        addSubview(view)
        
        view.snp.makeConstraints { make in
            make.left.equalTo(20)
            make.right.equalTo(-20)
            make.top.bottom.equalToSuperview()
        }
        
        let imageV = UIImageView()
        imageV.image = .qmui_image(withGradientColors: [.colorMake(253, 244, 229), .white], type: .vertical, locations: nil, size: CGSize(width: SCREEN_WIDTH - 40, height: 64), cornerRadiusArray: nil)
        view.addSubview(imageV)
        
        imageV.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
        let button = QMUIButton(title: "真实用户放款", titleColor: .color51, font: .mSFont(16))
        button.isUserInteractionEnabled = false
        button.imagePosition = .left
        button.setImage(UIImage(named: "detail_list"), for: .normal)
        button.spacingBetweenImageAndTitle = 5
        view.addSubview(button)
        
        button.snp.makeConstraints { make in
            make.left.equalTo(20)
            make.centerY.equalToSuperview()
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
